Examples of HTML <marquee> Tag
Example 1: In this example, we will see implementation of above tag with right to left.
<!DOCTYPE html>
<html>
<head>
<title>Marquee Tag</title>
<style>
.main {
text-align: center;
}
.marq {
padding-top: 30px;
padding-bottom: 30px;
}
.geek1 {
font-size: 36px;
font-weight: bold;
color: white;
padding-bottom: 10px;
}
</style>
</head>
<body>
<div class="main">
<marquee class="marq" bgcolor="Green"
direction="left" loop="">
<div class="geek1">
w3wiki
</div>
<div class="geek2">
A computer science portal for geeks
</div>
</marquee>
</div>
</body>
</html>
Output:
Example 2:
In this example, we will see implementation of above tag with another example from bottom to up.
<!DOCTYPE html>
<html>
<head>
<title>Marquee Tag</title>
<style>
.main {
text-align: center;
font-family: "Times New Roman";
}
.marq {
padding-top: 30px;
padding-bottom: 30px;
}
.geek1 {
font-size: 36px;
font-weight: bold;
color: white;
text-align: center;
}
.geek2 {
text-align: center;
}
</style>
</head>
<body>
<div class="main">
<marquee class="marq" bgcolor="Green"
direction="up" loop="">
<div class="geek1">
w3wiki
</div>
<div class="geek2">
A computer science portal for geeks
</div>
</marquee>
</div>
</body>
</html>
Output:
Example 3: In this example, we will see implementation of above tag from up to bottom.
<!DOCTYPE html>
<html>
<head>
<title>Marquee Tag</title>
<style>
.main {
text-align: center;
font-family: "Times New Roman";
}
.marq {
padding-top: 30px;
padding-bottom: 30px;
}
.geek1 {
font-size: 36px;
font-weight: bold;
color: white;
text-align: center;
}
.geek2 {
text-align: center;
}
</style>
</head>
<body>
<div class="main">
<marquee class="marq" bgcolor="Green"
direction="down" loop="">
<div class="geek1">
w3wiki
</div>
<div class="geek2">
A computer science portal for geeks
</div>
</marquee>
</div>
</body>
</html>
Output:
HTML Tag
The <marquee> tag in HTML creates a scrolling text or image effect within a webpage. It allows content to move horizontally or vertically across the screen, providing a simple way to add dynamic movement to elements. It includes attributes like direction to specify whether the content moves left, right, up, or down.
Note: This tag is deprecated from HTML5.